package com.kehutong.crm.message.enums;

import org.coraframework.util.HashID;
import com.kehutong.common.enums.TemplateType;

/**
 * 按业务模块进行拆分，此处新增时，在{@link TemplateType}同步新增一条记录，使其保持一致
 *
 * 这么做的理由是，部分场景需要按业务类型区分，部分场景需要全部类型数据，因为时间比较紧，暂时没有想到更好的方案，故...
 */
public interface MessageConfigEnum {

    /**
     * 缴费
     */
    enum Pay implements HashID {

        PAY_SUCCESS("PAY_SUCCESS", "缴费成功", true),
        PAY_CALL("PAY_CALL", "催缴通知", true),

        // 缴费V2版本
        PAY_B_TASK_REMIND("PAY_B_TASK_REMIND", "催费任务消息提醒", true),
        PAY_B_TASK_SUCCESS_REMIND("PAY_B_TASK_SUCCESS_REMIND", "催费任务关联房屋缴费完成提醒（非催费任务不需提醒）", true),
        PAY_C_BILL_SUCCESS("PAY_C_BILL_SUCCESS", "缴费完成", true),
        PAY_C_TASK_REMIND("PAY_C_TASK_REMIND", "物业对用户未缴账单催费", true),
        PAY_C_MONTH_BILL_DATE("PAY_C_MONTH_BILL_DATE", "月度账单账单日", true),
        ;

        private final String id;
        private final String desc;
        private final boolean completed;

        private Pay(String id, String desc, boolean completed) {
            this.id = id;
            this.desc = desc;
            this.completed = completed;
        }

        @Override
        public String getId() {
            return id;
        }

        @Override
        public String getDesc() {
            return desc;
        }

        public boolean isCompleted(){
            return completed;
        }
    }

    /**
     * 住户
     */
    enum Resident implements HashID {

        RESIDENT_B_ADD("RESIDENT_B_ADD", "管理的楼栋/单元/房屋新增住户时提醒管家", true),
        RESIDENT_B_AUDIT("RESIDENT_B_AUDIT", "管家管理的楼栋/单元/房屋有用户提交住户审核时提醒管家", false),
        RESIDENT_C_AUDIT_SUCCESS("RESIDENT_C_AUDIT_SUCCESS", "用户提交的住户申请审核通过反馈通知", false),
        RESIDENT_C_AUDIT_FAIL("RESIDENT_C_AUDIT_FAIL", "用户提交的住户申请审核不通过反馈通知", false),
        ;

        private final String id;
        private final String desc;
        private final boolean completed;

        private Resident(String id, String desc, boolean completed) {
            this.id = id;
            this.desc = desc;
            this.completed = completed;
        }

        @Override
        public String getId() {
            return id;
        }

        @Override
        public String getDesc() {
            return desc;
        }

        public boolean isCompleted(){
            return completed;
        }
    }

    /**
     * 工单
     */
    enum WorkOrder implements HashID {

        WO_B_CREATE_SEND("WO_B_CREATE_SEND", "处理人接收工单(包括转交的内部/外部工单）", false),
        WO_B_URGE("WO_B_URGE", "处理人的内部/外部工单被催办", false),
        WO_B_DELAY_REMINDER("WO_B_DELAY_REMINDER", "处理人的内部/外部工单延时提醒", false),
        WO_B_REPLY("WO_B_REPLY", "处理人的外部工单被发起人评价", false),
        WO_C_SUCCESS("WO_C_SUCCESS", "发起人的工单处理完成", true),
        WO_C_REPLY("WO_C_REPLY", "发起人的工单评论有回复", true),

        ;

        private final String id;
        private final String desc;
        private final boolean completed;

        private WorkOrder(String id, String desc, boolean completed) {
            this.id = id;
            this.desc = desc;
            this.completed = completed;
        }

        @Override
        public String getId() {
            return id;
        }

        @Override
        public String getDesc() {
            return desc;
        }

        public boolean isCompleted(){
            return completed;
        }
    }

    /**
     * 系统公告
     */
    enum Sys implements HashID {

        SYS_MESSAGE("SYS_MESSAGE", "系统公告", true),
        ;

        private final String id;
        private final String desc;
        private final boolean completed;

        private Sys(String id, String desc, boolean completed) {
            this.id = id;
            this.desc = desc;
            this.completed = completed;
        }

        @Override
        public String getId() {
            return id;
        }

        @Override
        public String getDesc() {
            return desc;
        }

        public boolean isCompleted(){
            return completed;
        }
    }
}
